Skip to content

Static routes support and critical lifecycle issues fixed - #119

Merged
sirkirby merged 2 commits into
devfrom
feature/static-routes
Sep 23, 2025
Merged

Static routes support and critical lifecycle issues fixed#119
sirkirby merged 2 commits into
devfrom
feature/static-routes

Conversation

@sirkirby

@sirkirby sirkirby commented Sep 23, 2025

Copy link
Copy Markdown
Owner

New

Adds support for Static Routes. UNR will now create and maintain switches for each static route policy you have defined. fixes #101

Fixes

Network and profile switches could accidentally be removed from Home Assistant after toggling an unrelated rule. This was a bug introduced the v4.0.0 release. fixes #118


This pull request adds support for static routes to the UniFi Network Rules integration, enabling monitoring and management of static network routing configurations. The changes update documentation, constants, API endpoint definitions, and the data coordinator to handle static routes alongside existing rule types.

Static Route Support

  • Added static route management and monitoring to the documentation, including usage examples and trigger/filter options for automations in README.md. [1] [2] [3] [4] [5]
  • Defined new API endpoints and path fragments for static routes in api_endpoints.py and exposed them in constants (API_ENDPOINT_STATIC_ROUTES, API_ENDPOINT_STATIC_ROUTE_DETAIL, API_PATH_STATIC_ROUTES, API_PATH_STATIC_ROUTE_DETAIL). [1] [2] [3] [4] [5] [6]

Coordinator Enhancements

  • Integrated static routes into the data coordinator: added a static_routes collection, included static route checks in change detection and deletion logic, and ensured static routes are fetched, updated, and preserved during authentication failures or API errors. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

sirkirby and others added 2 commits September 23, 2025 10:22
- Introduced a new StaticRoute model for managing static network routes.
- Enhanced the coordinator to handle static route updates and retrieval.
- Added a switch entity for static routes to enable/disable them within Home Assistant.
- Updated the README to include static routes in the integration documentation.
- Implemented triggers for monitoring static route changes.
- Added unit tests for static routes functionality, ensuring robust integration and error handling.
@sirkirby sirkirby self-assigned this Sep 23, 2025
@sirkirby sirkirby added bug Something isn't working enhancement New feature or request labels Sep 23, 2025
@sirkirby
sirkirby merged commit 34eaa2c into dev Sep 23, 2025
9 checks passed
@sirkirby
sirkirby deleted the feature/static-routes branch September 23, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant